package org.example.back.controller.plan;

import org.example.back.entity.plan.FitnessVideo;
import org.example.back.service.plan.FitnessVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/videos")
public class FitnessVideoController {

    @Autowired
    private FitnessVideoService service;

    @PostMapping
    public void insert(@RequestBody FitnessVideo video) {
        service.addVideo(video);
    }

    @GetMapping
    public List<FitnessVideo> getAll() {
        return service.getAllVideos();
    }
}